package beans;

import ourImage.OurPlanarImage;
import ourfilter.SaveFilter;
import pimpmypipe.interfaces.Readable;
import ourfilter.SaveFilter;
/**
 *
 * @author Meraner Marcel
 */
public class SaveFilterBean extends FilterBaseBean<SaveFilter> {
    private String _outFile = "filteredImage.jpg";
    private boolean _filterEnabled = false;
    
    
    @Override
    public boolean isFilterEnabled() {
        return _filterEnabled;
    }

    public void setFilterEnabled(boolean enabled) {
        if (enabled != _filterEnabled) {
            _filterEnabled = enabled;
            filteringAndNotify();
        }
    }
    
    public String getOutFile() {
        return _outFile;
    }

    public void setOutFile(String outFile) {
        if (!_outFile.equals(outFile)) {
            _outFile = outFile;
            notifyImageListener();
        }
    }
    
    
    @Override
    protected SaveFilter getConcreteFilter(Readable<OurPlanarImage> in) {
        return new SaveFilter(in, this);
    }

    @Override
    protected SaveFilter configureConcreteFilter(SaveFilter filter) {
        filter.setOutFile(_outFile);
        filter.setFilterEnabled(_filterEnabled);
        return filter;
    }

    
    @Override
    public String getFilterName() {
        return "Save Filter";
    }
}
